package commonDataStructures;

import java.util.ArrayList;

/**
 * @author avishl02
 * this class represents an array with some additions attributes, like if the array's
 * length is n, one can put an elements at index 2*n without worrying about the
 * actions involve in it  
 * @param <E> the type of the array
 */
public class SuperArray<E> extends ArrayList<E>{ 

	/**
	 * 
	 */
	private static final long serialVersionUID = 0L;
	
	//ctor
	public SuperArray(){
		super();
	}
	
	//ctor with init capacity
	public SuperArray(int capacity){
		super(capacity);
	}
	
	//insert an element to a specific index
	public E set(int index,E elem){
		while(super.size()  <= index){
			super.add(null);
		}
		return super.set(index, elem);
	
	}
}
